'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
    const { router, controller } = app;
    // 函数总览
    router.post('/api/get_function_total', controller.slsFuncTotal.get_function_total);
    router.post('/api/invoke_function', controller.slsFuncTotal.invoke_function);
    router.post('/api/get_active', controller.slsFuncTotal.get_active);
    router.post('/api/update_function', controller.slsFuncTotal.update_function);
    // 新建函数
    router.post('/api/new_code', controller.slsFuncNew.new_code);
    router.post('/api/new_docker', controller.slsFuncNew.new_docker);
    router.post('/api/get_docker', controller.slsFuncNew.get_docker);
    // 集群状态
    router.post('/api/get_cluster_status', controller.slsClusterStatus.get_cluster_status);
    // 系统日志
    router.post('/api/get_system_log', controller.slsSysLog.get_system_log);
    // 设置
    router.post('/api/get_setting_config', controller.slsSetting.get_setting_config);
    router.post('/api/set_password', controller.slsSetting.set_password);
    router.post('/api/del_node', controller.slsSetting.del_node);
    router.post('/api/del_func', controller.slsSetting.del_func);
    // 默认
    router.get('/*', controller.hello.get);
    router.post('/*', controller.hello.post);
};